package com.gxuwz.controller;

import java.util.Map;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

public interface ICurdController<T> {

	/**
	 * 
	 * @Title: openAddView 
	 * @Description: 打开增加页面
	 * @param @return
	 * @return String
	 * @throws
	 */
	@RequestMapping(value = "/openAddView")
	public String openAddView();
	
	/**
	 * 
	 * @Title: add 
	 * @Description: 执行增加操作
	 * @param @param t
	 * @param @param model
	 * @param @return
	 * @return Map<String,Object>
	 * @throws
	 */
	@ResponseBody
	@RequestMapping(value = "/add",method = RequestMethod.POST)
	public Map<String,Object> add(T t,Model model);
	
	/**
	 * 
	 * @Title: list 
	 * @Description: 打开列表页面
	 * @param @param model
	 * @param @return
	 * @return String
	 * @throws
	 */
	@RequestMapping(value = "/list")
	public String list(Model model,T t);
	
	/**
	 * 
	 * @Title: delete 
	 * @Description: 执行删除操作
	 * @param @param t
	 * @param @return
	 * @return Map<String,Object>
	 * @throws
	 */
	@ResponseBody
	@RequestMapping(value = "/delete",method = RequestMethod.POST)
	public Map<String,Object> delete(T t);
	
	/**
	 * 
	 * @Title: openUpdateView 
	 * @Description: 打开更新页面
	 * @param @return
	 * @return String
	 * @throws
	 */
	@RequestMapping(value = "/openUpdateView",method = RequestMethod.GET)
	public String openUpdateView(String id,Model model);
	
	/**
	 * 
	 * @Title: update 
	 * @Description: 执行更新操作
	 * @param @param t
	 * @param @return
	 * @return Map<String,Object>
	 * @throws
	 */
	@ResponseBody
	@RequestMapping(value = "/update",method = RequestMethod.POST)
	public Map<String,Object> update(T t);
	
	
}
